package com.css.fxfzypg.modules.baseData.controller;

import com.css.fxfzypg.base.response.RestResponse;
import com.css.fxfzypg.logInfo.SysLog;
import com.css.fxfzypg.modules.baseData.queryParams.PbeQueryParams;
import com.css.fxfzypg.modules.baseData.entity.PbeEntity;
import com.css.fxfzypg.modules.baseData.service.PbeService;
import com.css.fxfzypg.modules.hypergraph.service.HypergraphService;
import com.css.fxfzypg.modules.maps.queryParams.MapQueryParams;
import com.css.fxfzypg.modules.maps.service.PbeMapService;
import com.css.fxfzypg.modules.qhmapfiles.service.QhMapFilesService;
import com.css.fxfzypg.util.PlatformObjectUtils;
import com.css.fxfzypg.util.PlatformPageUtils;
import com.css.fxfzypg.web.PlatformSessionContext;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author y1fan
 * @create 2022-08-11 9:30
 * 人口建筑物经济公里格网数据子模块
 */
@RestController
@RequestMapping("/fxfzypg/baseData")
@Slf4j
public class PbeController {


    @Resource
    private PbeService pbeService;

    @Resource
    PbeMapService pbeMapService;//地图使用

    @Autowired
    private QhMapFilesService qhMapFilesService;//文件管理

    //获取配置文件的上传文件路径
    @Value("${file.upload.path}")
    private String uploadPath;

    @Resource
    HypergraphService hypergraphService;

    @RequestMapping("/savePbe")
    public RestResponse savePbe(@RequestBody PbeEntity pbeEntity){
        RestResponse restResponse = null;
        try {
            PbeEntity pbeEntity1 = pbeService.savePbe(pbeEntity);
          restResponse.succeed(pbeEntity1);
          restResponse.setMessage("新增人口建筑物经济公里格网数据成功");
        } catch (Exception e) {
            log.error("新增人口建筑物经济公里格网数据失败",e);
           restResponse.fail("新增人口建筑物经济公里格网数据失败");
        }
        return restResponse;
    }

    @GetMapping("/getPbeById/{id}")
    public RestResponse getPbeById(@PathVariable("id")String id){
        RestResponse restResponse = null;
        try {
            PbeEntity pbeEntity=  pbeService.fingPbeById(id);
             restResponse.succeed(pbeEntity);
             restResponse.setMessage("查询人口建筑物经济公里格网数据成功");
        } catch (Exception e) {
        log.error("查询人口建筑物经济公里格网数据失败",e);
            restResponse.fail("查询人口建筑物经济公里格网数据失败");
        }
        return restResponse;
    }

    @GetMapping("/getAllPbe")
    public RestResponse getAllPbe(HttpServletRequest request, PbeQueryParams queryParams){
        RestResponse restResponse = null;
        try{
        //    int curPage = Integer.valueOf(request.getParameter(PlatformPageUtils.CUR_PAGE));
         //   int pageSize = Integer.valueOf(request.getParameter(PlatformPageUtils.PAGE_SIZE));
            queryParams.setCurPage(Integer.parseInt(PlatformPageUtils.CUR_PAGE_DEF));
            queryParams.setPageSize(Integer.parseInt(PlatformPageUtils.PAGE_SIZE_DEF));
            restResponse = RestResponse.succeed(pbeService.getAllPbeByParams(queryParams));
            restResponse.setMessage("查询人口建筑物经济公里格网数据成功");
        }catch (Exception e){
            log.error("查询人口建筑物经济公里格网数据失败!",e);
            restResponse = RestResponse.fail("查询人口建筑物经济公里格网数据失败");
        }
        return restResponse;
    }

    @PostMapping("/updatePbe")
    public RestResponse updatePbe(@RequestBody PbeEntity pbeEntity){
        try {
            PbeEntity pbeEntity1=   pbeService.updatePbe(pbeEntity);
            return RestResponse.succeed(pbeEntity1);
        } catch (Exception e) {
            log.error("更新人口建筑物经济公里格网数据失败",e);
            return RestResponse.fail("更新人口建筑物经济公里格网数据失败");
        }
    }
    @PostMapping("/deletePbe/{ids}")
    public RestResponse deletePbe(@PathVariable("ids") List<String> ids){
        try {
            pbeService.deletePbe(ids);
            return RestResponse.succeed("删除成功");
        } catch (Exception e) {
            log.error("删除失败",e);
            return RestResponse.fail("删除失败");
        }
    }

    @PostMapping("/pbeExportExcel")
    public void exportExcel(HttpServletResponse response) throws Exception {

        try {
            pbeService.exportExcel(response);
        RestResponse.succeed("导出成功");
        } catch (IOException e) {
            log.error("导出失败!",e);
          RestResponse.fail("导出失败!");
        }


    }


    @PostMapping("/pbeImportExcel")
    public RestResponse importExcel(MultipartFile file)throws IOException {
        RestResponse restResponse = null;
        try {
            pbeService.importExcel(file);
            restResponse = RestResponse.succeed("导入成功");
        } catch (IOException e) {
            log.error("导入失败!",e);
            restResponse = RestResponse.fail("导入失败!");

        }
        return restResponse;
    }

    /*zyt修改--start*/
    /**
     * 全查询  模糊查询未设定条件
     * @param request
     * @param queryParams
     * @return
     */
    @SysLog("地图查询人口建筑物经济公里格网")
    @GetMapping("/getAllPbeData")
    public RestResponse getAllPbeData(HttpServletRequest request, PbeQueryParams queryParams){

        RestResponse restResponse = null;
        try{
            //查询条件
            String province = request.getParameter("province");
            String city = request.getParameter("city");
            String county = request.getParameter("county");
            String fileUuid = request.getParameter("fileUuid");
            String uuid = request.getParameter("uuid");
            queryParams.setProvince(province);
            queryParams.setCity(city);
            queryParams.setCounty(county);
            queryParams.setFileuuid(fileUuid);
            queryParams.setUuid(uuid);
            restResponse = RestResponse.succeed(pbeMapService.getAllData(queryParams));
        }catch (Exception e){
            log.error("查询数据失败!",e);
            restResponse = RestResponse.fail("查询数据失败");
        }
        return restResponse;
    }
    /**
     * 根据ID查询数据
     */
    @GetMapping("/getPbeDataById/{id}")
    public RestResponse getPbeDataById(@PathVariable("id") String id){

        RestResponse restResponse = null;
        try{
            restResponse = RestResponse.succeed(pbeMapService.getDataById(id));
        }catch (Exception e){
            log.error("查询数据失败!",e);
            restResponse = RestResponse.fail("查询数据失败");
        }
        return restResponse;
    }
    /**
     * 根据文件ids逻辑删除文件及相关数据
     */
    @PostMapping("/delPbeFileData/{ids}")
    public RestResponse delPbeFileData(@PathVariable("ids") List<String> ids) {
        RestResponse restResponse = null;
        try{
            String userID = PlatformSessionContext.getUserID();
            pbeMapService.deleteFileData(ids,userID);
            //刷新指定超图工作空间数据源数据集
            boolean bool = hypergraphService.getWorkspaceReload("data_pbe");
            restResponse = RestResponse.succeed("删除成功");
        }catch (Exception e){
            log.error("删除失败!",e);
            restResponse = RestResponse.fail("删除失败!");
        }
        return restResponse;
    }

    /**
     * 批量上传文件
     *
     * @param files
     * @return
     */
    @PostMapping("/pbeUpload")
    public RestResponse uploadSpaceData(@RequestParam("files") MultipartFile[] files, MapQueryParams queryParams) {
        System.out.println(new Date()+"-----------1.开始上传文件");
        //数据校验
        if (ObjectUtils.isEmpty(files) && files.length <= 0) {
            return RestResponse.fail("上传失败，请选择文件");
        }
        String province = queryParams.getProvince();
        String city = queryParams.getCity();
        String area = queryParams.getArea();
        //判断是否已上传未保存文件--上传类型（人口建筑物经济公里格网_）
        int fileCount = qhMapFilesService.lookUpMapFiles("0","人口建筑物经济公里格网_","1",province,city,area);
        if(fileCount>0) {
            return RestResponse.succeed("【" + province + "-" + city + "-" + area + "】已上传文件等待数据入库, 若要上传最新数据请稍后在【管理】功能中删除数据.");
        }

        //判断是否已上传正在保存文件--上传类型（人口建筑物经济公里格网_）
        fileCount = qhMapFilesService.lookUpMapFiles("2","人口建筑物经济公里格网_","1",province,city,area);
        if(fileCount>0) {
            return RestResponse.succeed("【" + province + "-" + city + "-" + area + "】已上传文件数据正在入库, 若要上传最新数据请稍后在【管理】功能中删除数据.");
        }

        //判断是否已存在上传数据--上传类型（人口建筑物经济公里格网_）
        fileCount = qhMapFilesService.lookUpMapFiles("1","人口建筑物经济公里格网_","1",province,city,area);
        if(fileCount>0) {
            return RestResponse.succeed("【" + province + "-" + city + "-" + area + "】已上传数据, 若要上传最新数据请先在【管理】功能中删除数据.");
        }

        // 返回的消息
        StringBuilder returnMsg = new StringBuilder();

        //gdb文件名
        String gdbFileName = "";
        //shp文件名
        String jxfilename = "";
        //String dbffilename = "";
        SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
        String formatDate = df.format(new Date());
        //判断是否为GDB文件 如果不是则处理并上传文件
        for (MultipartFile file : files) {
            //获取上传原文件名称
            String oldFileName = file.getOriginalFilename();
            //是否存在gdb文件
            if ("gdb".equals(oldFileName)) {
                return RestResponse.succeed("请上传正确的CGCS2000坐标系数据.");
            }
            // SHP文件 上传后文件名
            String fName = oldFileName.substring(0, oldFileName.indexOf("."));
            String prefix = "人口建筑物经济公里格网_";
            String postfix = oldFileName.substring(oldFileName.indexOf("."));
            String district = (StringUtils.isBlank(province) ? "0" : province) + "_" + (StringUtils.isBlank(city) ? "0" : city) + "_" + (StringUtils.isBlank(area) ? "0" : area);
            String newFileName = prefix + "_" + district + "_" + fName + "_" + formatDate + postfix;
            if (newFileName.contains(".shp") && newFileName.endsWith(".shp")) {
                jxfilename = newFileName;
            }
//            if (oldFileName.contains(".dbf") && oldFileName.endsWith(".dbf")) {
//                dbffilename = newFileName;
//            }
            File folder = new File(uploadPath);
            File saveFile = new File(uploadPath + newFileName);
            if (!saveFile.getParentFile().exists()) {
                saveFile.getParentFile().mkdirs();
            }
            try {
                //上传文件
                file.transferTo(new File(folder, newFileName));
                returnMsg.append(oldFileName);
                returnMsg.append(",");
            } catch (IOException e) {
                e.printStackTrace();
                return RestResponse.fail(oldFileName + "上传失败");
            }
        }
        System.out.println(new Date()+"-----------2.上传文件成功--"+jxfilename+gdbFileName);
        String resultMsg = returnMsg.substring(0, returnMsg.length() - 1);
        //SHP文件
        System.out.println(new Date()+"-----------3.开始importShapeFile");
        String resMsg = pbeMapService.checkSHPFiles(uploadPath + jxfilename, province, city, area, formatDate, PlatformSessionContext.getUserID());
        System.out.println(new Date()+"-----------4.结束importShapeFile");

        if(resMsg.contains("导入成功")){
            //上传成功
            //刷新指定超图工作空间数据源数据集
            boolean bool = hypergraphService.getWorkspaceReload("data_pbe");
            System.out.println(new Date()+"-----------5.上传成功." + resMsg);
        }else{
            System.out.println(new Date()+"-----------5.上传失败." + resMsg);
        }
        if (resMsg.indexOf("checkNotCGCS2000") != -1) return RestResponse.succeed("请上传正确的CGCS2000坐标系数据及.prj文件.");
        if (resMsg.indexOf("messyCode") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "信息有乱码.");
        if (resMsg.indexOf("fieldNullValue") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "字段值存在空值, 请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("GeometryIsNotEqualsCoordinate") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "填报经纬度属性值与Geometry不一致, 请检查数据正确性.");
        if(resMsg.indexOf("fieldNumError")!=-1) return RestResponse.succeed("上传文件中字段数量不符合要求, 请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("idFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "Id不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("populationFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "人口（人）不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("coveredareaFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "建筑面积（平方米）不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("gdpFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "GDP（万元）不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("townorcontryFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "城镇/农村不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("provinceCityCountyFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "省市县名称不匹配，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("jglxFormatError") != -1){
            String jglxType = resMsg.split(",")[1];
            return RestResponse.succeed(resMsg.split("#")[0] + jglxType+"结构类型占比不能为负数，请对照字段说明检查数据的正确性.");
        }
        if (resMsg.indexOf("jglxTotalFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "的全部结构类型占比之和应为100%（可在99到100之间），请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("zzfwzbFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "住宅房屋占比不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("空间数据类型错误") != -1) return RestResponse.succeed(resMsg.split("#")[0] + resMsg);

        return RestResponse.succeed(resultMsg + "上传成功.<br/>" + resMsg);
    }
    /*zyt修改--end*/
    /**
     * 批量上传文件
     *
     * @param files
     * @return
     */
    @PostMapping("/pbeUpload1")
    public RestResponse uploadSpaceDataBak(@RequestParam("files") MultipartFile[] files, MapQueryParams queryParams) {
        System.out.println(new Date()+"-----------1.开始上传文件");
        //数据校验
        if (files == null && files.length <= 0) {
            return RestResponse.fail("上传失败，请选择文件");
        }
        String province = queryParams.getProvince(), city = queryParams.getCity(), area = queryParams.getArea();
        //if ("".equals(province) ) return RestResponse.fail("请选择场地所在省份!");
        //if ("".equals(city)) return RestResponse.fail("请选择场地所在城市!");
        //if ("".equals(area)) return RestResponse.fail("请选择场地所在区县!");

        //判断是否已上传未保存文件--上传类型（人口建筑物经济公里格网_）
        int fileCount = qhMapFilesService.lookUpMapFiles("0","人口建筑物经济公里格网_","1",province,city,area);
        if(fileCount>0) {
            return RestResponse.succeed("【" + province + "-" + city + "-" + area + "】已上传文件等待数据入库, 若要上传最新数据请稍后在【管理】功能中删除数据.");
        }

        //判断是否已上传正在保存文件--上传类型（人口建筑物经济公里格网_）
        fileCount = qhMapFilesService.lookUpMapFiles("2","人口建筑物经济公里格网_","1",province,city,area);
        if(fileCount>0) {
            return RestResponse.succeed("【" + province + "-" + city + "-" + area + "】已上传文件数据正在入库, 若要上传最新数据请稍后在【管理】功能中删除数据.");
        }

        //判断是否已存在上传数据--上传类型（人口建筑物经济公里格网_）
        fileCount = qhMapFilesService.lookUpMapFiles("1","人口建筑物经济公里格网_","1",province,city,area);
        if(fileCount>0) {
            return RestResponse.succeed("【" + province + "-" + city + "-" + area + "】已上传数据, 若要上传最新数据请先在【管理】功能中删除数据.");
        }

        //判断是否已存在上传数据--数据数量查询
//        PbeQueryParams pbeQueryParams = new PbeQueryParams();
//        pbeQueryParams.setProvince(province);
//        pbeQueryParams.setCity(city);
//        pbeQueryParams.setCounty(area);
//        int dataCount = pbeMapService.getAllDataCount(pbeQueryParams);
//        if(dataCount>0) return RestResponse.succeed("【" + province + "-" + city + "-" + area + "】已上传数据, 若要上传最新数据请先在【管理】功能中删除数据.");

        // 返回的消息
        StringBuilder returnMsg = new StringBuilder();

        String gdbFileName = "";//gdb文件名
        String jxfilename = "";//shp文件名
        String dbffilename = "";
        SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
        String formatDate = df.format(new Date());
        //判断是否为GDB文件
        for (MultipartFile file : files) {
            //获取上传原文件名称
            String oldFileName = file.getOriginalFilename();
            if (oldFileName.equals("gdb")) {//是否存在gdb文件
                String fName = "新建文件地理数据库";
                String postfix = ".gdb";
                String prefix = "人口建筑物经济公里格网_";
                String district = (province == null ? "0" : province) + "_" + (city == null ? "0" : city) + "_" + (area == null ? "0" : area);
                gdbFileName = prefix + "_" + district + "_" + fName + "_" + formatDate + postfix;
                break;
            }
        }

        //循环处理每一个文件
        for (MultipartFile file : files) {
            //获取上传原文件名称
            String oldFileName = file.getOriginalFilename();
            String newFileName = "";
            if(!PlatformObjectUtils.isEmpty(gdbFileName)) {//GDB文件
                newFileName = gdbFileName + "/"+oldFileName;
            }else {//SHP文件
                // 上传后文件名
                String fName = oldFileName.substring(0, oldFileName.indexOf(".")), postfix = oldFileName.substring(oldFileName.indexOf("."));
                String prefix = "人口建筑物经济公里格网_";
                String district = (province == null ? "0" : province) + "_" + (city == null ? "0" : city) + "_" + (area == null ? "0" : area);
                newFileName = prefix + "_" + district + "_" + fName + "_" + formatDate + postfix;
                if (newFileName.contains(".shp") && newFileName.endsWith(".shp")) {
                    jxfilename = newFileName;
                }
                if (oldFileName.contains(".dbf") && oldFileName.endsWith(".dbf")) {
                    dbffilename = newFileName;
                }
            }
            File folder = new File(uploadPath);
            File savefile = new File(uploadPath + newFileName);
            if (!savefile.getParentFile().exists()) {
                savefile.getParentFile().mkdirs();
            }
            try {
                //file.transferTo(savefile);
                //File _file = new File(uploadPath + newFileName);
                //FileUtils.copyInputStreamToFile(file.getInputStream(), _file);
                //上传文件
                file.transferTo(new File(folder, newFileName));
                returnMsg.append(oldFileName);
                returnMsg.append(",");
            } catch (IOException e) {
                e.printStackTrace();
                return RestResponse.fail(oldFileName + "上传失败");
            }
            //returnMsg.append(oldFileName);
            //returnMsg.append(",");
        }
        System.out.println(new Date()+"-----------2.上传文件成功--"+jxfilename+gdbFileName);
        String resultMsg = returnMsg.substring(0, returnMsg.length() - 1);
        String resMsg = "";
        String userID = PlatformSessionContext.getUserID();//登录用户ID
        if(!PlatformObjectUtils.isEmpty(gdbFileName)) {//GDB文件
            resultMsg = gdbFileName;//返回GDB文件名
            System.out.println(new Date()+"-----------3.开始importGDBFile");
            //resMsg = qhRiskLevelMapService.checkGDBFiles(uploadPath + gdbFileName, province, city, area);
            System.out.println(new Date()+"-----------4.结束importGDBFile");
            if (resMsg.indexOf("spatialReferenceError") != -1) return RestResponse.succeed("请上传正确的CGCS2000坐标系数据.");
        }else{//SHP文件
            System.out.println(new Date()+"-----------3.开始importShapeFile");
            resMsg = pbeMapService.checkSHPFiles(uploadPath + jxfilename, province, city, area, formatDate, userID);
            System.out.println(new Date()+"-----------4.结束importShapeFile");
        }
        if(resMsg.indexOf("导入成功") != -1){//上传成功
            //刷新指定超图工作空间数据源数据集
            boolean bool = hypergraphService.getWorkspaceReload("data_pbe");
            System.out.println(new Date()+"-----------5.上传成功." + resMsg);
        }else{
            System.out.println(new Date()+"-----------5.上传失败." + resMsg);
        }
        if (resMsg.indexOf("checkNotCGCS2000") != -1) return RestResponse.succeed("请上传正确的CGCS2000坐标系数据及.prj文件.");
        if (resMsg.indexOf("messyCode") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "信息有乱码.");
        if (resMsg.indexOf("fieldNullValue") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "字段值存在空值, 请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("GeometryIsNotEqualsCoordinate") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "填报经纬度属性值与Geometry不一致, 请检查数据正确性.");
        if(resMsg.indexOf("fieldNumError")!=-1) return RestResponse.succeed("上传文件中字段数量不符合要求, 请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("idFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "Id不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("populationFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "人口（人）不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("coveredareaFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "建筑面积（平方米）不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("gdpFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "GDP（万元）不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("townorcontryFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "城镇/农村不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("provinceCityCountyFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "省市县名称不匹配，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("jglxFormatError") != -1){
            String jglxType = resMsg.split(",")[1];
            return RestResponse.succeed(resMsg.split("#")[0] + jglxType+"结构类型占比不能为负数，请对照字段说明检查数据的正确性.");
        }
        if (resMsg.indexOf("jglxTotalFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "的全部结构类型占比之和应为100%（可在99到100之间），请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("zzfwzbFormatError") != -1) return RestResponse.succeed(resMsg.split("#")[0] + "住宅房屋占比不符合字段要求，请对照字段说明检查数据的正确性.");
        if (resMsg.indexOf("空间数据类型错误") != -1) return RestResponse.succeed(resMsg.split("#")[0] + resMsg);

        return RestResponse.succeed(resultMsg + "上传成功.<br/>" + resMsg);
    }
}
